#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define MAXSIZE 50

typedef int Elem;
typedef struct {
	Elem data[MAXSIZE];
	int len;
}SqlList;
bool insertList(SqlList& L,int& a) {
	for (int i = L.len; i > 1;i--) {
		L.data[i] = L.data[i-1];
	}
	L.data[1] = a;
	L.len++;
	return true;
}
void printList(SqlList& L) {
	for (int i = 0; i < L.len; i++)
	{
		printf("%3d", L.data[i]);
	}
	printf("\n");
}
bool deleteList(SqlList& L,int a) {
	if (a<1 ||a>L.len) {
		return false;
	}
	if(a != L.len) {
		for (int i = a-1; i < L.len-1; i++)
		{
			L.data[i] = L.data[i + 1];
		}
	}
	L.len--;
	return true;
}
int main() {
	SqlList s;
	s.data[0] = 1;
	s.data[1] = 2;
	s.data[2] = 3;
	s.len = 3;
	int i;
	scanf("%d",&i);
	if (insertList(s, i))
	{
		printList(s);
	}
	else
	{
		printf("fall\n");
	}
	int j;
	scanf("%d", &j);
	if (deleteList(s, j))
	{
		printList(s);
	}
	else
	{
		printf("false\n");
	}
}